import java.util.*;

public class A {
	public static void main(String[] args) {
		var sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ret = 0;
		for(int i = 1; i <= n - 1; i ++ ) {
			ret += sc.nextInt();
		}
		System.out.print(-1 * ret + "\n");
	}
	
}
